import React from 'react';
import HTML5Backend from 'react-dnd-html5-backend';
import { DragDropContext } from 'react-dnd';

@DragDropContext(HTML5Backend)
class DNDWraper extends React.PureComponent {
  render() {
    return this.props.children;
  }
}

export default () => {
  return {
    renderEditor: (props, editor, next) => {
      const children = next();
      return <DNDWraper>{children}</DNDWraper>;
    }
  };
};
